package com.zh.hello.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhanghuan
 * @date: 2022/9/11 09:15
 * @description: create it
 */
@RestController
public class HelloController {

    @RequestMapping("/hello")
    public String hello() {
        return "hello springboot";
    }
    @RequestMapping(value = "/user", method = RequestMethod.GET)
    public String getUser() {
        return "GET-zhangsan";
    }
    @RequestMapping(value = "/user", method = RequestMethod.POST)
    public String saveUser() {
        return "POST-zhangsan";
    }
    @RequestMapping(value = "/user", method = RequestMethod.PUT)
    public String putUser() {
        return "PUT-zhangsan";
    }
    @RequestMapping(value = "/user", method = RequestMethod.DELETE)
    public String deleteUser() {
        return "DELETE-zhangsan";
    }
}
